package com.itheima.service.impl;

import com.aliyuncs.DefaultAcsClient;
import com.itheima.dao.VideoDao;
import com.itheima.pojo.Video;
import com.itheima.service.VideoService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class VideoServiceImpl implements VideoService {
    @Autowired
    private VideoDao videoDao;
    //查询视频通过套餐id
    @Override
    public List<Video> getAllVoidTable(Integer setmealId) {
       List<Video> list= videoDao.getAllVoidById(setmealId);
        return list;
    }
//查询视频通过视频id
    @Override
    public List<Video> findVideoByVideoId(Integer videoId) {
      List<Video> list=  videoDao.findVideoByVideoId(videoId);
        return list;
    }



//添加视频信息
    @Override
    public void addVideo(String videoId,String fileName,String videoUrl,Integer setmealId) {
        Video video = new Video();
        video.setVideosourceid(videoId);
        video.setVideooriginalname(fileName);
        video.setVoidurl(videoUrl);
        video.setSetmeal_id(setmealId);
       //添加视频
        videoDao.addVideo(video);

    }
}
